﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WindowsServiceSample
{
    using Preflight.ServiceModel;

    class Program
    {
        static void Main(string[] args)
        {
            var preflightSelfHostConfiguration =
                PreflightSelfHostConfiguration.Create(
                    ApplicationVerificationFactoryBuilder.CreateFactory(),
                    PreflightSelfHostedServiceOptions.Create(1000));

            preflightSelfHostConfiguration.ServiceOptions.SecurityMode = PreflightServiceSecurityMode.None;
            preflightSelfHostConfiguration.ErrorDetailPolicy = System.Web.Http.IncludeErrorDetailPolicy.Always;

            using(var selfHost = PreflightSelfHost.Create(preflightSelfHostConfiguration))
            {
                selfHost.Start();
                Console.WriteLine("Listening on port 1000. Hit enter to exit...");
                Console.ReadLine();
                selfHost.Stop();
            }
        }
    }
}
